package com.zua.test;

import com.zua.ZuaMarketApplication;
import com.zua.entity.Good;
import com.zua.util.JedisUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import redis.clients.jedis.Jedis;

import java.util.HashSet;
import java.util.Set;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = ZuaMarketApplication.class)
public class Redis {
    @Test
    public void testJedis(){
        Jedis jedis = JedisUtils.getJedis();
        jedis.set("name","hanxiang2");
//        String name = jedis.get("name");
//        System.out.println("name = " + name);
        jedis.close();

    }
    @Test
    public void sgtd(){
        HashSet<Good> goods = new HashSet<>();
        goods.add(new Good());
        System.out.println(goods);
    }
}
